home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 1645 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1002 b 

  1. Path: gryphon.phoenix.net!usenet
  2. From: brucew@phoenix.net (Bruce Wedding)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Help:  crash when doing fprintf
  5. Date: Tue, 16 Jan 1996 01:35:07 GMT
  6. Organization: BranPaul Systems
  7. Message-ID: <4det25$rpp@gryphon.phoenix.net>
  8. References: <DL74rA.L5v@info.physics.utoronto.ca>
  9. NNTP-Posting-Host: dial35.phoenix.net
  10. X-Newsreader: Moe's Newsreader    
  11.  
  12. olivers@helios.physics.utoronto.ca (Oliver Schonborn) wrote:
  13.  
  14. >    printf("Outputting to %s...\n",fout);
  15. >    fp=fopen(fout,"w");
  16. >    fprintf(fp,"Hello\n");
  17.  
  18. >This is what fp points to at crash time:
  19.  
  20. >0x40001038  struct FILE {
  21. >    __cnt = 0;
  22. >    __ptr =   00000000;
  23. >    __base =   00000000;
  24.  
  25. Judging from these values, you are printing to a null pointer.  Have
  26. you checked to see if the file opened, because you aren't in this
  27. code.
  28.  
  29.  
  30. Bruce D. Wedding                        Have Compiler, Will Travel!
  31.               Perspicacious Programming Performed Promptly
  32. Katy, Texas, USA, Planet Earth, Milkyway Galaxy, Known Universe
  33.  
  34.